using System;
using System.Collections.Generic;
using System.Text;
using GoldenAgeHelper.db;
using System.Data;

namespace GoldenAgeHelper.DAL
{
    public class EnvirConfig
    {
        public static void AddEnvirConfig(int cid, int envirid, string jinengname, int dengji, string name)
        {

            string sql = "insert into envirconfig(cid,envirid,jinengtype,dengji,typename) values('" + cid + "','" + envirid + "','" + jinengname + "','" + dengji + "','" + name + "')";
            //string sql1 = "update envirconfig";
            Database.helper.ExecuteNonQuery(sql);
        }

        public static void AddEnvirConfig(int cid, int envirid, string envirname, string name, string jinengname, int lvl, string pos, string typename)
        {
            string sql = "insert into envirbase(cid,envirid,envirname,rname,type,lvl,pos,typename) values('" + cid + "','" + envirid + "','" + envirname + "','" + name + "','" + jinengname + "','" + lvl + "','" + pos + "','" + typename + "')";
            //string sql1 = "update envirconfig";
            Database.helper.ExecuteNonQuery(sql);
        }

        public static bool Exists(int cid, int envirid)
        {
            string sql1 = "select count(1) from envirconfig where cid='" + cid + "' and envirid='" + envirid + "'";
            object obj = Database.helper.ExecuteScalar(sql1);
            return Convert.ToInt32(obj) > 0;
        }

        public static DataTable GetLvyou(int cid)
        {
            string sql = "select * from ";
            return null;
        }
    }
}
